<?php

namespace App\Http\Controllers\Api;

use App\Handlers\FacePhotoHandler;
use App\Jobs\FacePhoto;
use App\Models\Student;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class FacePhotoController extends Controller
{
    public function scanFace($id)
    {
        $student = Student::find($id);
        FacePhoto::dispatch($student);
    }

    public function scanFaceList()
    {
        $students = Student::where(['is_scaned' => 0])->get();

        foreach ($students as $student){
            FacePhoto::dispatch($student);
        }
    }
}
